Skip to content

Conversation

@rahul2393
Copy link
Contributor

@rahul2393 rahul2393 commented Jan 13, 2026

  • Deprecated all session pool classes (FixedSizePool, BurstyPool, PingingPool, TransactionPingingPool) with deprecation warnings
  • pool parameter is now ignored in Database and Instance.database() - shows deprecation warning when passed
  • Removed internal pool creation and fallback logic - multiplexed sessions are now always used
  • Removed BatchCreateSessions RPC calls - only CreateSession (for multiplexed) is used
  • Cleaned up pool-related code from DB-API connection handling

@rahul2393 rahul2393 requested review from a team as code owners January 13, 2026 06:39
@product-auto-label product-auto-label bot added size: xl Pull request size is extra large. api: spanner Issues related to the googleapis/python-spanner API. labels Jan 13, 2026
@gemini-code-assist
Copy link

Summary of Changes

Hello @rahul2393, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly refactors the session management within the Spanner client library by fully embracing multiplexed sessions. It removes the outdated session pooling infrastructure, simplifying the codebase and ensuring that all database operations benefit from the efficiency of multiplexed sessions by default. The change also introduces deprecation warnings for any lingering usage of the old pool parameters, guiding users towards the new, streamlined approach.

Highlights

  • Session Pool Removal: The legacy session pooling mechanism has been entirely removed, including the _own_pool attribute and related logic for clearing session pools on connection closure.
  • Mandatory Multiplexed Sessions: All session management now exclusively uses multiplexed sessions, eliminating conditional logic based on environment variables or experimental hosts.
  • Deprecation Warnings: The pool parameter in Database and Instance constructors is now deprecated and will issue a DeprecationWarning if used, as session pools are no longer utilized.
  • Simplified Session Management API: The DatabaseSessionsManager has been streamlined; get_session always returns a multiplexed session, and put_session is now a no-op for multiplexed sessions.
  • Test Suite Refactoring: Extensive updates have been made across unit and system tests to remove all references to session pools and adapt to the new multiplexed-only session model, including the removal of the test_pool.py file.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request is a significant and well-executed refactoring that removes session pools and makes multiplexed sessions the default and only option for the Spanner client library. This change simplifies the session management architecture. The old session pool classes and related parameters are now deprecated, with clear warnings and documentation updates to ensure backward compatibility. The implementation is clean, and the tests have been comprehensively updated to reflect these architectural changes, including the removal of obsolete tests and updates to mocks. Overall, the changes are excellent and improve the library.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: spanner Issues related to the googleapis/python-spanner API. size: xl Pull request size is extra large.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants